package de.tabuma.sso.sso;

import java.util.*;

import javax.jdo.*;
import javax.jdo.annotations.*;

/**
 * @author $Author: alefen $
 * @version $Revision: 1.1.1.1.2.1 $
 * @since $Date: 2010/01/08 10:03:24 $
 */
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class SSO {

    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    Long id;
    public Long getId() {
        return id;
    }
    
    @Persistent
    int userId;
    public int getUserId() {
        return userId;
    }
    public void setUserId(int userID) {
        this.userId = userID;
    }

    @Persistent
    String ssoId;
    public String getSsoId() {
        return ssoId;
    }
    public void setSsoId(String ssoID) {
        this.ssoId = ssoID;
    }

    @Persistent
    Date date;
    public Date getDate() {
        return date;
    }
    public void setDate(Date date) {
        this.date = date;
    }
    
    public long getLastTimeInMinutes() {
        return (Calendar.getInstance().getTimeInMillis() - date.getTime())/1000/60;
    }
}